package p2pcdnsim.cdn;

import java.util.Map;
import java.util.TreeMap;

import p2pcdnsim.network.ApplicationProcess;

import desmoj.core.simulator.Model;


public abstract class OriginServer extends ApplicationProcess {

	protected CDN cdn;
	protected String id;
	protected Map<Long,ObjectContent> contents;
	
	public OriginServer(Model owner, String name, CDN cdn) {
		super(owner, name);
		this.id = name;
		this.cdn = cdn;
		this.contents = new TreeMap<Long,ObjectContent>();
	}

	public String toString() {
		return id;
	}

	public void addContent(ObjectContent content) {
		contents.put(content.getObjectId(), content);
	}
	
	public ObjectContent getContent(long objectId) {
		return contents.get(objectId);
	}
	
}
